<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta name="viewport" content="width=device-width,initial-scale=1.0,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta name="format-detection" content="telephone=no" />
    <meta name="format-detection" content="email=no" />
    <meta name="apple-mobile-web-app-capable" content="yes" />
    <meta name="apple-mobile-web-app-status-bar-style" content="black" />
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href="css/mui.min.css" />
    <link rel="stylesheet" href="css/reset.css" />
    <link rel="stylesheet" href="css/forgetpassword.css" />
    <script src="js/vue.js"></script>
    <script src="js/axios.js"></script>
    <title>忘记密码</title>
</head>
<body>
<header></header>
<div class="content">
    <!--让内容居中显示-->
    <div class="outside">
        <input type="text" name='tele' placeholder="请输入手机号" v-model="userTel">
        <div class='yz'>
            <input type="text" name='yzm' v-model="userCode" placeholder="请输入验证码">
            <button type="button" @click="getCode">获取验证码</button>
        </div>
        <input type="password" name='passwrd' v-model="userPwd" placeholder="请输入新密码">
        <!-- 提交 -->
        <button type="button" @click="sub">确定</button>
        <!-- 返回登录 -->
        <div class='returnLogin'>
            <a href="login.html"><span>返回登录</span></a>
        </div>
    </div>
</div>
<footer>
</footer>
<script src="js/mui.min.js"></script>
<script type="text/javascript" charset="utf-8">
    const API_PROXY = 'https://bird.ioliu.cn/v1/?url='
    new Vue({
        el:'.content',
        data:{
            userCode:'',
            userTel:'',
            userPwd:''
        },
        methods:{
            //获取验证码
            getCode(){
                axios.post(API_PROXY + 'mingpian.32one.top/Index/Login/SendSms',{
                    phone:this.userTel,
                    type:'number'
                }).then(res=>{
                    mui.toast(res.data.msg.message)
                })
            },
            //提交修改信息
            sub(){
                axios.post(API_PROXY + 'mingpian.32one.top/Index/Login/forgetPwd',{
                    phone:this.userTel,
                    code:this.userCode,
                    password:this.userPwd
                })
                    .then(res=>{
                        if (res.data.code == -1){
                            mui.toast(res.data.msg)
                        }
                    })
            }
        }
    })

</script>
</body>

</html>
